﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace KiraSh.ResumeTracker
{
    public static class PathHelper
    {
        private static string userDirPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),"ResumeTracker");

        public static string MapCombine(params string [] paths){
            string combinedPaths = userDirPath;
            foreach (string path in paths){
                if (Path.IsPathRooted(path)){
                    throw new ArgumentException("Path is rooted, cannot be mapped to user directory: " + path);
                }
                combinedPaths = Path.Combine(combinedPaths, path);
            }
            return combinedPaths;
        }

        public static string Combine(params string[] paths)
        {
            string combinedPaths = "";
            foreach (string path in paths)
            {
                combinedPaths = Path.Combine(combinedPaths, path);
            }
            return combinedPaths;
        }
    }
}
